/**   
 * @Title: ChooseStylePopAlertView.java 
 * @Package com.esun.lottery.shiyixuanwu.alertviews 
 * @Description: TODO(十一选五玩法选择弹出Alert View) 
 * @author Miko baoz@500wan.com   
 * @date 2011-1-15 下午03:08:29  
 */
package com.esun.rabbit2.viewer.mainact.lotteryhallact.shiyixuanwu.rabbittrunk;

import com.esun.ui.R;
import com.esun.util.log.EDebug;

import android.content.Context;
import android.view.View;
import android.widget.Button;

/**
 * @ClassName: ChooseStylePopAlertView
 * @Description: TODO(十一选五玩法选择弹出Alert View)
 * @author Miko baoz@500wan.com
 * @date 2011-1-15 下午03:08:29
 * 
 */
public class ChooseStylePopAlert extends AlertFather implements View.OnClickListener {

	/**
	 * <p>
	 * Title:
	 * </p>
	 * <p>
	 * Description:
	 * </p>
	 * 
	 * @param context
	 */
	public ChooseStylePopAlert(Context context, View view, Button tvStyle) {
		super(context, view, tvStyle);
		// TODO Auto-generated constructor stub
		EDebug.o(this, "Choose Style Init start !");
		super.init(buttonID, this, layou);
		EDebug.o(this, "Choose Style Init end !");

		chooseDetailPopAlert = new ChooseDetailPopAlert(context, view, tvStyle);
	}

	private ChooseDetailPopAlert chooseDetailPopAlert;

	// button 所有的id
	private int[] buttonID = {
								R.id.shiyixuanwu_container_alert_stylelList_cancel,
								R.id.shiyixuanwu_container_alert_styleList_choose1,
								R.id.shiyixuanwu_container_alert_styleList_choose2,
								R.id.shiyixuanwu_container_alert_styleList_choose3,
								R.id.shiyixuanwu_container_alert_styleList_choose4,
								R.id.shiyixuanwu_container_alert_styleList_choose5,
								R.id.shiyixuanwu_container_alert_styleList_choose6,
								R.id.shiyixuanwu_container_alert_styleList_choose7,
								R.id.shiyixuanwu_container_alert_styleList_choose8 };

	// Alert的Layoout
	private int layou = R.layout.shiyixuanwu_container_alert_stylelist;

	/**
	 * @Title: alerShow
	 * @Description: TODO(显示Alert)
	 * @return void
	 */
	public void alertShow() {

		super.alerShow();

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see android.view.View.OnClickListener#onClick(android.view.View)
	 */
	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {

		case R.id.shiyixuanwu_container_alert_styleList_choose1:

			ShiyixuanwuPlayStyle.getPlayStyle().resetAllButtons();

			ShiyixuanwuPlayStyle.getPlayStyle().setStyle(1);

			ShiyixuanwuPlayStyle.getPlayStyle().setDetailBtnDisabled(1);

			ShiyixuanwuPlayStyle.getPlayStyle().setDetail(2);

			ShiyixuanwuPlayStyle.getPlayStyle().setDetailTemp("前一直选");

			super.alertCancel(false);
			break;

		case R.id.shiyixuanwu_container_alert_styleList_choose2:

			ShiyixuanwuPlayStyle.getPlayStyle().resetAllButtons();

			ShiyixuanwuPlayStyle.getPlayStyle().setStyle(2);

			ShiyixuanwuPlayStyle.getPlayStyle().setDetailBtnDisabled(2);

			if (ShiyixuanwuPlayStyle.getPlayStyle().getDetail() == 1) {
				ShiyixuanwuPlayStyle.getPlayStyle().setDetailTemp("任选二");
				// ShiyixuanwuPlayStyle.getPlayStyle().
			} else if (ShiyixuanwuPlayStyle.getPlayStyle().getDetail() == 2) {
				ShiyixuanwuPlayStyle.getPlayStyle().setDetailTemp("直选二");
			} else if (ShiyixuanwuPlayStyle.getPlayStyle().getDetail() == 3) {
				ShiyixuanwuPlayStyle.getPlayStyle().setDetailTemp("组选二");
			}

			chooseDetailPopAlert.alertShow();

			super.alertCancel(false);
			break;

		case R.id.shiyixuanwu_container_alert_styleList_choose3:

			ShiyixuanwuPlayStyle.getPlayStyle().resetAllButtons();

			ShiyixuanwuPlayStyle.getPlayStyle().setStyle(3);

			ShiyixuanwuPlayStyle.getPlayStyle().setDetailBtnDisabled(3);

			if (ShiyixuanwuPlayStyle.getPlayStyle().getDetail() == 1) {
				ShiyixuanwuPlayStyle.getPlayStyle().setDetailTemp("任选三");
			} else if (ShiyixuanwuPlayStyle.getPlayStyle().getDetail() == 2) {
				ShiyixuanwuPlayStyle.getPlayStyle().setDetailTemp("直选三");
			} else if (ShiyixuanwuPlayStyle.getPlayStyle().getDetail() == 3) {
				ShiyixuanwuPlayStyle.getPlayStyle().setDetailTemp("组选三");
			}

			chooseDetailPopAlert.alertShow();

			super.alertCancel(false);
			break;

		case R.id.shiyixuanwu_container_alert_styleList_choose4:

			ShiyixuanwuPlayStyle.getPlayStyle().resetAllButtons();

			ShiyixuanwuPlayStyle.getPlayStyle().setStyle(4);

			ShiyixuanwuPlayStyle.getPlayStyle().setDetailBtnDisabled(4);

			ShiyixuanwuPlayStyle.getPlayStyle().setDetail(1);

			ShiyixuanwuPlayStyle.getPlayStyle().setDetailTemp("任选四");

			super.alertCancel(false);
			break;

		case R.id.shiyixuanwu_container_alert_styleList_choose5:

			ShiyixuanwuPlayStyle.getPlayStyle().resetAllButtons();

			ShiyixuanwuPlayStyle.getPlayStyle().setStyle(5);

			ShiyixuanwuPlayStyle.getPlayStyle().setDetailBtnDisabled(5);

			ShiyixuanwuPlayStyle.getPlayStyle().setDetail(1);

			ShiyixuanwuPlayStyle.getPlayStyle().setDetailTemp("任选五");

			super.alertCancel(false);
			break;

		case R.id.shiyixuanwu_container_alert_styleList_choose6:

			ShiyixuanwuPlayStyle.getPlayStyle().resetAllButtons();

			ShiyixuanwuPlayStyle.getPlayStyle().setStyle(6);

			ShiyixuanwuPlayStyle.getPlayStyle().setDetailBtnDisabled(6);

			ShiyixuanwuPlayStyle.getPlayStyle().setDetail(1);

			ShiyixuanwuPlayStyle.getPlayStyle().setDetailTemp("任选六");

			super.alertCancel(false);
			break;

		case R.id.shiyixuanwu_container_alert_styleList_choose7:

			ShiyixuanwuPlayStyle.getPlayStyle().resetAllButtons();

			ShiyixuanwuPlayStyle.getPlayStyle().setStyle(7);

			ShiyixuanwuPlayStyle.getPlayStyle().setDetailBtnDisabled(7);

			ShiyixuanwuPlayStyle.getPlayStyle().setDetail(1);

			ShiyixuanwuPlayStyle.getPlayStyle().setDetailTemp("任选七");

			super.alertCancel(false);
			break;

		case R.id.shiyixuanwu_container_alert_styleList_choose8:

			ShiyixuanwuPlayStyle.getPlayStyle().resetAllButtons();

			ShiyixuanwuPlayStyle.getPlayStyle().setStyle(8);

			ShiyixuanwuPlayStyle.getPlayStyle().setDetailBtnDisabled(8);

			ShiyixuanwuPlayStyle.getPlayStyle().setDetail(1);

			ShiyixuanwuPlayStyle.getPlayStyle().setDetailTemp("任选八");

			super.alertCancel(false);
			break;

		case R.id.shiyixuanwu_container_alert_stylelList_cancel:

			super.alertCancel(true);
			break;
		}
	}

}
